<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
 
    <script type="text/javascript" src="js/common/jquery.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
    <script src="https://cdn.bootcss.com/moment.js/2.22.0/moment-with-locales.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
    
    <style type="text/css">
			.myrow {
				display: flex;
				flex-direction: row;
				margin-left:1em;
			}
    </style>
</head>
<!--获取年月-->
<!--监听结束-->
<body>
 
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">
      <div class="row">
          <div class="col-md-12">
              <div class="col-lg-6">
                  <div class="form-group ">
			<div class="myrow">
				<div class='input-group date' style="width: 14em;" id='datetimepicker1'>
                    <span class="input-group-addon">选择时间
                    <span class="glyphicon glyphicon-calendar"></span>
					</span>
					<input type='text' class="timeInput form-control" id="date"/>
				</div>
				<button class="btn btn-default" onclick="getDateFunction()">提交日期</button>
			</div>
		</div>
              </div>
          </div>
      </div>
 
	  <p id="date1"></p>
  </div>
 
</div>
<script>
    $(function () {
        $('#form1').hide();
        var picker1 = $('#datetimepicker1').datetimepicker({
            format: 'YYYY-MM',
            locale: moment.locale('zh-cn'),
            //minDate: '2016-7-1'
        });
    });
    $('#datetimepicker1').datetimepicker({
        format: 'YYYY-MM-dd',
        locale: moment.locale('zh-cn'),
        defaultDate: '2020-4'
    });
</script>
</body>
</html>